var conturl = 'http://shengbb.com';
//var conturl = 'localhot';

mui.init();
mui.ready(function() {
		//主界面和侧滑菜单界面均支持区域滚动；
		mui('#offCanvasSideScroll').scroll();
		mui('#offCanvasContentScroll').scroll();
	})
//导航
mui.ready(function() {
	$('.mui-table-view-cell,.mui-bar-nav').on('tap', 'a', function() {
		document.location.href = this.href;
	});
})

//判断登录
$(document).ready(function() {
	$('.main_foot').on('tap', 'a', function() {
		document.location.href = this.href;
	});

	$.ajax({
		type: "post",
		url: "/baby/sys/getUserInfo",
		async: true,
		dataType: 'json',
		success: function(data) {
			if(data.code == 2000) {
				var uesrimg = '<img src=' + data.data.userHeadPic + ' />'
				$("#loginbtn").html(uesrimg)
				$("#loginbtn").attr("href", "#popover");

			} else if(data.code == 5001) {
				$("#loginbtn").addClass('loginbtn');
				$("#loginbtn").html('登录');
				$(".loginbtn").on('tap', function() {
					document.location.href = 'login.html';
				})

			}
		}
	});
})